<template>
	<view>
		<view class="">
			<text>充值：</text>
			<input type="text" v-model="price" />
		</view>
		<view class="price-list">
			<button :type="price === item ? 'primary': 'default'" @click="price = item" v-for="(item, index) in priceList" :key="index">充{{item}}元</button>
		</view>
		
		<button type="primary" @click="handlePay">支付</button>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';
	const price = ref(0)
	const priceList = [50, 60, 70, 80, 90, 100]
	
	const handlePay = () => {
		wx.requestPayment({
		  timeStamp: '',
		  nonceStr: '',
		  package: '',
		  signType: 'MD5',
		  paySign: '',
		  success (res) { },
		  fail (res) { }
		})
	}	
</script>

<style lang="scss">
.price-list {
	display: flex;
	flex-wrap: wrap;
	align-content: flex-start;
	align-items: flex-start;
}
</style>